import request from '@/utils/request'

const api_name = 'book'

export default {
    // 条件查询带分页获得图书信息
    listBook(searchObj) {
        return request({
            url: `${api_name}/list`,
            method: 'get',
            params: searchObj
        })
    },
    // 根据编号查询图书信息
    getBookDetail(bookNo) {
        return request({
            url: `${api_name}/${bookNo}`,
            method: 'get'
        })
    },
    // 添加图书
    addBook(form) {
        return request({
            url: `${api_name}`,
            method: 'post',
            data: form
        })
    },
    // 修改图书
    updateBook(form) {
        return request({
            url: `${api_name}`,
            method: 'put',
            data: form
        })
    },
    // 批量删除图书
    deleteBook(bookNoList) {
        return request({
            url: `${api_name}/${bookNoList}`,
            method: 'delete',
        })
    },
}
